package com.example.demo.commom.check;

import com.example.demo.model.dto.art.ArtListDto;
import com.example.demo.model.dto.art.ArticlePubDto;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2024-05-15
 * Time:8:11
 */
public class ArtControllerProcessor {
    public static boolean ckpub(ArticlePubDto dto) {
        if (dto.getContent() == null || dto.getTitle() == null || dto.getPhotos() == null || dto.getType() == null){
            return true;
        }
        return false;
    }
    public static boolean cklist(ArtListDto dto) {
        if(dto.getType() == null || dto.getType() <= 0 || dto.getType() > 5){
            return true;
        }
        if(dto.getStart() == null ){
            dto.setStart(0);
        }
        if(dto.getLimit() == null || dto.getLimit() == 0){
            dto.setLimit(5);
        }
        return false;
    }
}
